﻿/*
 * Created by SharpDevelop.
 * User: IEscarro
 * Date: 8/25/2009
 * Time: 3:19 PM
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */

using System;
using System.Drawing;
using System.Windows.Forms;
using System.Collections.Generic;
using Miming.Model;

namespace Miming.Gui
{
	/// <summary>
	/// Description of NotepadForm.
	/// </summary>
	public partial class NotepadForm : BaseForm
	{
		public NotepadForm(INotable n)
		{
			//
			// The InitializeComponent() call is required for Windows Forms designer support.
			//
			InitializeComponent();
			Model = n;
		}
		
		protected override void OnModelChanged(EventArgs e)
		{
			base.OnModelChanged(e);
			INotable n = Model as INotable;
			groupBoxNotes.Text = "Notes for " + n.Name;
			labelName.Text = n.ToString();
			richTextBoxNotes.Text = n.Notes;
		}
		
		void ButtonOkClick(object sender, EventArgs e)
		{
			INotable n = Model as INotable;
			n.Notes = richTextBoxNotes.Text;
			Close();
		}
		
		void ButtonCancelClick(object sender, EventArgs e)
		{
			Close();
		}
		
		void ButtonPrintClick(object sender, EventArgs e)
		{
			(Model as INotable).Print();
		}
	}
}
